package com.aranandroid.customview.squareview

import android.content.Context
import android.util.AttributeSet
import android.view.View.OnClickListener
import androidx.annotation.Nullable
import androidx.appcompat.widget.AppCompatRadioButton
import com.aranandroid.customview.R
import com.aranandroid.customview.squareview.base.SquareNormalView
import com.aranandroid.customview.squareview.base.SquareView

class SquareRadioButton(
    @Nullable context: Context?,
    @Nullable attrs: AttributeSet?,
    defStyleAttr: Int
) :
    AppCompatRadioButton(context!!, attrs, defStyleAttr) {

    var squareView: SquareView

    var radioValue:String?
    init {
        squareView = SquareView(context, attrs, defStyleAttr, this)
        buttonDrawable = null
        val obtainStyledAttributes =
            context!!.obtainStyledAttributes(attrs, R.styleable.SquareRadioButton)
        //圆角
        radioValue =
            obtainStyledAttributes.getString(R.styleable.SquareRadioButton_radio_value)
    }

    constructor(context: Context?, attrs: AttributeSet?) : this(
        context,
        attrs,
        android.R.attr.radioButtonStyle
    )

    constructor(context: Context?) : this(context, null) {

    }



}